import type { BytemdPlugin } from 'bytemd';
import rehypeHighlightCodeLines from 'rehype-highlight-code-lines';

export const codeLinesPlugin = (): BytemdPlugin => {
  return {
    rehype: (processor) =>
      processor
        // 添加代码行号
        .use(rehypeHighlightCodeLines, {
          showLineNumbers: true,
          lineContainerTagName: 'span',
        }),
  };
};
